//
//  SongListCell.m
//  MusicMenu
//
//  Created by Joe on 2014/12/3.
//  Copyright (c) 2014年 Tank. All rights reserved.
//

#import "SongListCell.h"


@implementation SongListCell
@synthesize buttonIndex,collection;

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(IBAction)musicPlayButtonPress:(id)sender{
    //傳送訊息，播放音樂
    
    NSArray *objects = [[NSArray alloc] initWithObjects:self.collection,[[NSString alloc] initWithFormat:@"%d",buttonIndex], nil];
    NSArray *keys = [[NSArray alloc] initWithObjects:@"collection",@"buttonIndex",nil];
    NSDictionary *dic = [[NSDictionary alloc] initWithObjects:objects
                                                      forKeys:keys];
    
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"playSong" object:dic];
}

@end
